import Vue from 'vue'
import App from './App'
import global from './common/js/global.js'        //全局参数
import common from './common/js/common.js'        //公用js
import users from './common/js/users.js'          //用户js
import vueExtend from './common/js/vue.extend.js' //vue扩展
import xdate from './common/js/xdate.min.js'      //日期插件
import menu from './common/js/menu.js'            //全局菜单
import filters from './common/js/filters.js'      //过滤器
import utils from './common/js/utils.js'      //过滤器
import  './common/js/sudoio'

vueExtend.init(Vue,common,xdate);
Vue.config.productionTip = false

Vue.prototype.$common = common;
Vue.prototype.$users = users;
Vue.prototype.$menu = menu;
Vue.prototype.XDate = xdate;
Vue.prototype.$filters = filters;
Vue.prototype.$global = global;
Vue.prototype.$utils = utils

import uniIcon from './components/uni-icon/uni-icon.vue'
import uniTag from './components/uni-tag/uni-tag.vue'
import myButton from './components/my-button/index'
import myMask from './components/my-mask/index'
import myHead from './components/my-head/index'


// #ifdef MP-TOUTIAO
import formBtn from './components/uni-z/form-btn.vue'
Vue.component('formBtn',formBtn)
// #endif

Vue.component('uniIcon',uniIcon)
Vue.component('uniTag',uniTag)
Vue.component('my-button',myButton)
Vue.component('my-mask',myMask)
Vue.component('my-head',myHead)

// 每次进入页面执行，记录每次浏览页面的次数
// 加载埋点
// 延迟1s,否则他们请求服务端的SDK文件前第一次执行会有问题
Vue.prototype.handleSugoioLoad = (title = 'AI智能测肤',code) => {
    setTimeout(() => {
    // debugger
    try {
        document.title = title
        window.sugoio.load(code,{})
    } catch (error) {
        console.log('error :>> ', error);
    }
    }, 1000);
}

// #ifdef MP-WEIXIN
// #endif

// #ifdef H5
import weixin from './common/js/weixin.js?v=1.0'        //微信相关
//import weixin from './common/js/qw-jweixin-1.2.0.js'        //微信相关
Vue.prototype.$weixin = weixin;
// #endif

App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
//console.log(app.$el.baseURI.toString())